﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Xms.Abp.BackgroundJob;

public interface IBackgroundScheduleStore
{
    Task<BackgroundScheduleInfo> FindAsync(Guid id, CancellationToken cancellationToken = default);
    
    Task<BackgroundScheduleInfo> FindAsync(string scheduleName, CancellationToken cancellationToken = default);

    Task InsertAsync(BackgroundScheduleInfo scheduleInfo, CancellationToken cancellationToken = default);

    Task<List<BackgroundScheduleInfo>> GetAllSchedulesAsync(CancellationToken cancellationToken = default);

    Task DeleteAsync(string scheduleName, CancellationToken cancellationToken = default);

    Task UpdateAsync(BackgroundScheduleInfo scheduleInfo, CancellationToken cancellationToken = default);

    Task<List<BackgroundScheduleInfo>> GetModifiedSchedulesAsync(DateTime lastCheckTime, CancellationToken cancellationToken = default);

    Task<List<BackgroundScheduleInfo>> GetDeletedSchedulesAsync(DateTime lastCheckTime, CancellationToken cancellationToken = default);
}
